import kotlinx.browser.document
import openfl.display.Stage
import starling.core.Starling
import starling.display.Sprite
import starling.text.TextField
import starling.text.TextFormat

@JsExport
class Game : Sprite() {
    init {
        val tf = TextFormat()
        tf.size = 20
        tf.color = 0xffffffff
        tf.horizontalAlign = "left"
        val txt = TextField(200, 30, "Hello Starling", tf)
        addChild(txt)
    }
}

fun main() {
    val stage = Stage(550, 400, 0x00000000)
    Starling(Game::class.js, stage).start()
    document.body?.appendChild(stage.element)
}